<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('编辑承办部门')"/>
    <link th:href="@{/ajax/libs/jQuery-ui/jquery-ui.css}" rel="stylesheet">
</head>
<body style="background-color: #F4F6FA">
<div class="main-content" style="margin: 0;padding: 0">

    <form id="form-user-add" th:object="${workFormBase}" class="form-horizontal" style="background-color: #F4F6FA">
        <input type="hidden" th:field="*{callId}">
        <input type="hidden" th:field="*{tapeId}">
        <input type="hidden" th:field="*{twfSendBackEty.pkId}" />
        <input type="hidden" th:field="*{twfSendBackEty.wfId}" />
        <div class="col-sm-12" style="display: flex">
            <div class="col-sm-12 entering-page">
                <!--    承办部门    -->
                <div class="col-sm-12 tltieBoder">
                    <div class="blueBorder"></div>
                    <h4 style="margin:0 0 0 10px">管理窗口-承办部门</h4>
                </div>
                <!-- 工单编号,工单性质..-->
                <div class="col-sm-12 work-top">
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">工单编号</label>
                        <div class="col-sm-8">
                            <input type="text" name="workFormNo" th:field="*{workFormNo}" disabled value="123"
                                   class="form-control" id="workNumber"
                                   placeholder="请输入名称">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">工单性质</label>
                        <div class="col-sm-8">
                            <select th:field="*{setProId}" id="workCharacter" onchange="dropChgSendTextOnly(this,'setProName');" class="form-control m-b phoneCategory">
                                <option value="11">普通工单</option>
                                <option value="21">督办工单</option>
                                <option value="31">呈批工单</option>
                            </select>
                            <input type="hidden" id="setProName" th:field="*{setProName}">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">工单主题</label>
                        <div class="col-sm-8">
                            <input type="text" name="wsTopic" th:field="*{wsTopic}" class="form-control" id="workSubject"
                                   placeholder="请输入名称">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle is-required">承办单位</label>
                        <div class="col-sm-8">
                            <input type="text" th:field="*{twfSendBackEty.sbdeptName}" class="form-control" id="deptShort" placeholder="" onclick="SelectDept()" required="required">
                            <input type="hidden" th:field="*{twfSendBackEty.sbdeptId}" id="noUnit">
                            <div class="input-group-append " style="position: absolute;top: 10px;right: 20px;">
                                <span class="glyphicon glyphicon-list-alt" style="color: #206ef7"></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle is-required">办理期限</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control transaction" id="transaction" th:field="*{twfSendBackEty.backLimit}"
                                   placeholder="请输入名称" required="required">
                            <div class="input-group-append " style="position: absolute;top: 10px;right: 20px;">
                                <span class="glyphicon glyphicon-calendar"></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle is-required">交办次序</label>
                        <div class="col-sm-8">
                            <select th:field="*{twfSendBackEty.seqCode}" id="workOrder" onchange="dropChgSendTextOnly(this,'seqName');" class="form-control m-b phoneCategory" required="required">
                                <option value="">-请选择-</option>
                                <option value="10">初次交办</option>
                                <option value="20">再次交办</option>
                                <option value="30">三次交办</option>
                            </select>
                            <input type="hidden" value="初次交办" id="seqName" th:field="*{twfSendBackEty.seqName}">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle is-required">办理性质</label>
                        <div class="col-sm-8">
                            <select th:field="*{twfSendBackEty.sortCode}" onchange="dropChgSendTextOnly(this,'sortName');" class="form-control m-b phoneCategory" required="required">
                                <option value="">-请选择-</option>
                                <option value="11">主办</option>
                            </select>
                            <input type="hidden" id="sortName" th:field="*{twfSendBackEty.sortName}" value="主办">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">办理方式</label>
                        <div class="col-sm-8">
                            <select th:field="*{twfSendBackEty.dealCode}" onchange="dropChgSendTextOnly(this,'dealName');" id="transactionWay" class="form-control m-b phoneCategory">
                                <option value="">-请选择-</option>
                                <option value="11">研究办理</option>
                                <option value="21">酌情办理</option>
                            </select>
                            <input type="hidden" id="dealName" th:field="*{twfSendBackEty.dealName}">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">派单时间</label>
                        <div class="col-sm-8">
                            <input type="text" th:field="*{twfSendBackEty.sendTime}" disabled class="form-control workTime" id="workTime" placeholder="请输入名称">
                        </div>
                    </div>
                </div>
                <div class="col-sm-12">
                    <div class="form-group col-sm-12">
                        <label class="control-label formTitle">办理要求</label>
                        <div class="col-sm-9">
                            <textarea th:field="*{twfSendBackEty.sendDesc}" maxlength="1000" class="form-control workRemark" rows="3"
                                      style="height: 150px"></textarea>
                            <span>还可以输入<i class="workRemarkI">1000</i>个文字</span>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12 work-top">
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">派单备注</label>
                        <div class="col-sm-8">
                            <input th:field="*{twfSendBackEty.sendRemark}" type="text" class="form-control" id="remark" placeholder="请输入名称">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">派发单位</label>
                        <div class="col-sm-8">
                            <input th:field="*{twfSendBackEty.sdeptName}" type="text" class="form-control" id="sdeptName"
                                   placeholder="请输入名称">
                            <input type="hidden" id="sdeptId" th:field="*{twfSendBackEty.sdeptId}">
                        </div>
                    </div>
                    <div class="form-group col-sm-4">
                        <label class="control-label formTitle">派发人</label>
                        <div class="col-sm-8">
                            <input th:field="*{twfSendBackEty.suserName}" type="text" class="form-control"
                                   id="distributePerson"
                                   placeholder="请输入名称">
                            <input type="hidden" th:field="*{twfSendBackEty.suserNo}">
                        </div>
                    </div>
                    <input name="deptId" id="deptId" th:value="${deptId}" type="hidden">
                    <input name="fpDirect" id="fpDirect" type="hidden">
                </div>
            </div>
        </div>
    </form>
</div>

<script th:src="@{/ajax/libs/layui/laydate.js}"></script>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/jQuery-ui/jquery-ui.js}"></script>
<script th:src="@{/js/deptdiag.js}"></script>


<script>
    var prefix = ctx + "gaoxin/system/sendBack";

    function submitHandler() {
        if ($.validate.form()) {
            let data = $('#form-user-add').serializeArray();
            $.operate.save(prefix + '/editDept',data);
        }
    }

    function SelectDept(){
        var config = {
            id: 'selectDeptDialog',
            title:'选择承办部门<span style="color:red;margin-left: 30px;">双击选中部门</span>',
            width:'1050',
            height:'550',
            url: ctx + 'system/test/deptTransfer',
            skin: 'layui-layer-gray',
            btn: ['关闭'],
            yes: function (index, layero) {
                top.layer.close(index);
            }
        }
        $.modal.openOptions(config);
    }

    function SonBackSingle(idS,nameS){
        $('#deptShort').val(nameS);
        $('#noUnit').val(idS);
    }

    function SonDirectSingle(sdeptNo,sdeptName,dNo,dName){
        $('#deptShort').val(dName);
        $('#noUnit').val(dNo);
        $('#sdeptName').val(sdeptName);
        $('#sdeptId').val(sdeptNo);
    }

</script>
</body>
</html>

